import string

path = '/book/noob/01/spring.txt'

with open(path, 'r') as text:
    words = [raw_word.strip(string.punctuation).lower() for raw_word in text.read().split()]
    print(words)
    words_index = set(words)
    count_dict = {word: words.count(word) for word in words_index}
    for word in sorted(count_dict, key=lambda x: count_dict[x], reverse=True):
        print('{} -> {} times'.format(word, count_dict[word]))
